<?php
namespace app\front\module\controller;
use app\model\User;
//使用命名空间才使用use 即use和namespace一起使用
//require_once _SYS_PATH . 'core/Controller.php';
class IndexController extends \Lonicera\core\Controller{
	
	public function indexAction(){
		//require_once _SYS_PATH . 'core/DB.php';
		//require_once _SYS_PATH . 'core/Model.php';
		//require_once _APP . 'model/User.php';
		
		$user = new User;
		$user->age = 20;
		$user->name = 'baicai';
		$user->save();
		//echo 'indexAction';
		$this->assign('age',$user->age+1);
		$this->assign('name','李白');
		//$this->display('index');
		$this->display();
	}
	
	public function hiAction(){
		require_once _SYS_PATH . 'core/DB.php';
		$db = DB::getInstance($GLOBALS['_config']['db']);
		$ret = $db->query('select * from o2o_user where age>:age and id>:id', ['age'=>10,'id'=>1]);
		var_dump($ret);
		echo 'hiAction';
	}
	
	public function updateAction(){
		
	}
}